<?php
namespace app\admin\controller;
use think\Controller;

class Common extends Controller{
	//保存管理员数据的变量
	public $info = array();

	public function __construct()
    {
    	parent::__construct();
		define('MODULE_NAME',$this->request->module());  // 当前模块名称是
		define('CONTROLLER_NAME',$this->request->controller()); // 当前控制器名称
		define('ACTION_NAME',$this->request->action()); // 当前操作名称是
    	$this->checkLogin();
    }

    //判断是否已经登陆
	private function checkLogin()
	{
		$this->info = session("info");

		if(!$this->info){
			$this->redirect("/admin/login/index");
		}else{
			$this->assign("info",$this->info);
		}
	}
}
